package com.provider.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.dubbo.api.dao.TestaDao;
import com.dubbo.api.dao.TestbDao;
import com.dubbo.api.pojo.TestaEntry;
import com.dubbo.api.pojo.TestbEntry;
import com.dubbo.api.service.ITestaService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class TestaServiceImpl extends ServiceImpl<TestaDao, TestaEntry> implements ITestaService {

    @Autowired
    private TestbDao testbDao;

    @Override
    public String add(String name) {
        TestaEntry testaEntry = TestaEntry.builder().name(name + " -> a").build();
        this.baseMapper.insert(testaEntry);

        int a = 1 / 0;

        TestbEntry testbEntry = TestbEntry.builder().name(name + " -> b").build();
        testbDao.insert(testbEntry);
        return null;
    }
}
